import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.2
import QtQuick.Controls 2.2 as C2
import QtQuick.Window 2.2
import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.0


import Charts 1.0

Rectangle {
    color: "lightgray"
    width: 500; height: 500
    implicitHeight: 500; implicitWidth: 500
    signal sendClicked(string str)  //定义信号

    property int v: 0
    function updateRotater() {// 定义函数
        v += 5
        textArea.text += v;
    }

    GridLayout {
        anchors.fill: parent
        rows: 2; columns: 2
        ColumnLayout {
            Layout.rowSpan: 2
            Layout.fillHeight: true;
            Layout.fillWidth: true
            C2.Button {
                text: "开始"
                onClicked: {
                    vm.outputString(text);
                    sendClicked("52152dsaf")
                }
            }
            C2.Button {
                text: "中止"
                onClicked: {
                    vm.outputString(text);
                }
            }
            C2.Button {
                text: "测试"
                onClicked: {
                    textArea.text = vm.returnValue(text);
                }
            }
        }
        Rectangle {
            Layout.fillHeight: true;
            Layout.fillWidth: true
            PieChart {
                id: aPieChart
                anchors.centerIn: parent
                width: 100; height: 100
                color: "red"

                onChartCleared: console.log("The chart has been cleared")
            }
            MouseArea {
                anchors.fill: parent
                onClicked: aPieChart.clearChart()
            }

        }
        Rectangle {
            Layout.fillHeight: true;
            Layout.fillWidth: true
            TextArea {
                id: textArea
                anchors.fill: parent
                readOnly: true
                text: qsTr("参数设置")
            }
        }
    }
}
